﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
      <title></title>
      <link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
      <link href="PageModel.css" rel="Stylesheet" type="text/css" />
      <script type="text/javascript" src="../../domExt.min.js"></script>
</head>
<body>
      <div class="fun_title">
            _h.Attr(obj, name);
      </div>
      <div class="fun_content">
            描述：获取DOM对象属性。<br />
      </div>
      <div class="fun_title2">
            参数:
      </div>
      <div class="fun_content2">
           obj：DOM对象<br />
           name：属性名称<br />
           <strong>Retrun:</strong>属性值<br />
           <br />
      </div>
      <div class="fun_title2">
            示例:
      </div>
       <div class="code">
            &lt;div id=&quot;div1&quot;&gt;&lt;div class=&#39;testclass&#39;&gt;testdiv&lt;/div&gt;&lt;/div&gt;
      </div>
      <div class="code">
            &lt;script type=&quot;text/javascript&quot;&gt;<br />
            &nbsp;&nbsp;&nbsp; 
            alert(_h.Attr(_g(&quot;#div1&quot;), &quot;id&quot;));<br />
            &lt;/script&gt;;</div>
            <br />
             <h:btn onclick="run_click();">执行脚本</h:btn>
             <br />
              <br />
             <div id="div1"><div class='testclass'>testdiv</div></div>
             <script type="text/javascript">
                   function run_click() {
                         alert(_h.Attr(_g("#div1"), "id"));
                  }
                   
             </script>
     
      
</body>
</html>
